
<h1><span class="yiyi-st" id="yiyi-12">numpy.unwrap</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.unwrap.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.unwrap.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="function">
<dt id="numpy.unwrap"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.</code><code class="descname">unwrap</code><span class="sig-paren">(</span><em>p</em>, <em>discont=3.141592653589793</em>, <em>axis=-1</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/lib/function_base.py#L1752-L1804"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">通过将值之间的delta改为2 * pi补码来展开。</span></p>
<p><span class="yiyi-st" id="yiyi-15">通过将大于<em class="xref py py-obj">discont</em>的绝对跳跃改变为沿给定轴的2 * pi补码，来展开弧度相位<em class="xref py py-obj">p</em>。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-16">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-17"><strong>p</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-18">输入数组。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-19"><strong>discont</strong>：float，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-20">值之间的最大不连续性，默认为<code class="docutils literal"><span class="pre">pi</span></code>。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-21"><strong>axis</strong>：int，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-22">解绕将沿其操作的轴，默认为最后一个轴。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-23">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-24"><strong>out</strong>：ndarray</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-25">输出数组。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-26">也可以看看</span></p>
<p class="last"><span class="yiyi-st" id="yiyi-27"><a class="reference internal" href="numpy.rad2deg.html#numpy.rad2deg" title="numpy.rad2deg"><code class="xref py py-obj docutils literal"><span class="pre">rad2deg</span></code></a>，<a class="reference internal" href="numpy.deg2rad.html#numpy.deg2rad" title="numpy.deg2rad"><code class="xref py py-obj docutils literal"><span class="pre">deg2rad</span></code></a></span></p>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-28">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-29">如果<em class="xref py py-obj">p</em>中的不连续小于<code class="docutils literal"><span class="pre">pi</span></code>，但大于<em class="xref py py-obj">discont</em>，则不进行解包，因为取2 *不连续性较大。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-30">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">phase</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phase</span><span class="p">[</span><span class="mi">3</span><span class="p">:]</span> <span class="o">+=</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phase</span>
<span class="go">array([ 0.        ,  0.78539816,  1.57079633,  5.49778714,  6.28318531])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">unwrap</span><span class="p">(</span><span class="n">phase</span><span class="p">)</span>
<span class="go">array([ 0.        ,  0.78539816,  1.57079633, -0.78539816,  0.        ])</span>
</pre></div>
</div>
</dd></dl>
